#include "../source/Server_version1.hpp"
#include <string>
int main()
{
    std::string ip = "127.0.0.1";
    u_int16_t port = 9999;

    muduo::Socket cli_socket;
    cli_socket.CreateClient(port, ip);

    while (1)
    {
        std::string msg = "hello world";
        cli_socket.Send((void*)msg.c_str(), msg.size());

        char buffer[1024];
        bzero(buffer, sizeof(buffer));
        int n = cli_socket.Recv(buffer, sizeof(buffer) - 1);
        std::cout << "客户端收到信息了" << std::endl;
        buffer[n] = 0;
        DBG_LOG("echo: %s", buffer);
        sleep(1);
    }
    cli_socket.Close();
}